﻿<%@ Page Language="C#" MasterPageFile="~/Shared/FormPage.Master" AutoEventWireup="true"  StylesheetTheme="GlobleTheme" CodeBehind="CustomerPerformanceView.aspx.cs" Inherits="Runda.CMS.Portal.Finiance.CustomerPerformanceView" Title="客户应收账款" %>
<%@ Register Assembly="AspNetPager" Namespace="Wuqi.Webdiyer" TagPrefix="webdiyer" %>
<%@ Register Assembly="RadAjax.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>
<%@ Register Assembly="RadGrid.Net2" Namespace="Telerik.WebControls" TagPrefix="rad" %>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="server"> 

<script src="../Content/global.js" type="text/javascript"></script> 
<script src="../Content/jquery-1.3.2.min.js" type="text/javascript"></script>     
    <link href="../Content/global.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Menu/Menu.css" rel="stylesheet" type="text/css" /> 
    <link href="../Content/Find/find.css" rel="stylesheet" type="text/css" />
    <link href="../Content/Pager.css" rel="stylesheet" type="text/css" />
     <script type="text/javascript"> 
     
         function OnRowDblClick(sender, eventArgs) {

             //alert("DblClick on row instance: " + eventArgs.get_itemIndexHierarchical());

         }

         $(function() {

             var CustSum = $('#<%=hfcustsum.ClientID %>').val();
             var NatSum = $('#<%=hfNatSUm.ClientID %>').val();
             var ExchSum = $('#<%=hfExchSum.ClientID %>').val();
             var AccountPayable = $('#<%=hfAccountPayable.ClientID %>').val();
             var AccountPayableEx = $('#<%=hfAccountPayableEx.ClientID %>').val();
             var Reward = $('#<%=hfReward.ClientID %>').val();
             var Fine = $('#<%=hfFine.ClientID %>').val();

             $('#ctl00_cphFormArea_gridList_ctl01').append("<tr class='GridFooter_OCM' style='white-space:nowrap;text-align:left;'><td width='260px'>合计：" + CustSum + "个客户</td><td width='30px'></td><td width='70px'></td><td width='120px'>" + NatSum + "</td><td width='120px'>" + ExchSum + "</td><td width='120px'>" + AccountPayable + "</td><td width='120px'>" + AccountPayableEx + "</td><td width='120px'>" + Reward + "</td><td width='120px'>" + Fine + "</td><td width='60px'></td></tr>");
         })
    </script>
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="cphFormArea" runat="server">
<div class="area">
<div class="Container">
        <table id="appFind" class="find" cellspacing="0" cellpadding="0" border="0"> 
            <tbody>
                <tr height="23">
                    <td class="wizHead" colspan="4">
                        <table style="table-layout: fixed; font-size: 9pt" cellspacing="0" cellpadding="0" width="100%" height="100%">
                            <colgroup>
                                <col>
                                <col width="60">
                                <col width="60"> 
                                <tr><td style="color:#ffffff"><b>查询</b></td><td class="icMenu mnuRight" noWrap></td></tr>
                        </table>
                    </td>
                </tr>
                <tr id="__appFind_trQuery" height="40">
                    <td class="wizBox1">
                    <table id="__appFind_tbQuery1" style="TABLE-LAYOUT: fixed; FONT-SIZE: 9pt" height="100%" cellSpacing="0" cellPadding="0" width="100%">
                    <tr>
                        <td style="width:25%">
                            <asp:RadioButtonList ID="rbUfaccountno" 
                            runat="server" RepeatDirection="Horizontal">
                        <asp:ListItem Value="%" Selected="True">全部</asp:ListItem>
                        <asp:ListItem Value="-002">润达实业</asp:ListItem>
                        <asp:ListItem Value="-008">润达医疗</asp:ListItem>
                        </asp:RadioButtonList></td>
                        <td align="center" style="width:15%">客户名称或地址：</td>
                        <td align="center" style="width:35%">
                            <asp:TextBox ID="txtCustomerName" runat="server"></asp:TextBox></td>
                        <td align="center" style="width:12%"><asp:Button ID="btnSearch" runat="server" Text="查找" CssClass="button" onclick="btnSearch_Click"/></td>
                        <td align="center" style="width:13%"><asp:Button ID="btnExportExcel" runat="server" Text="导出(Excel)" CssClass="button" onclick="btnExportExcel_Click"/></td>
                    </tr></table>
                    </td>
                </tr>
            </tbody>
    </table>            
</div>
 <div class="Container">         
         <table class="mnubar" cellspacing="0" cellpadding="0">
            <tbody>
                <tr>
                    <td style="padding-left: 5px" nowrap>
                        <b>列表</b>
                    </td>
                    <td style="padding-left: 5px">
                        <img src="../Content/Grid/separator.gif">
                    </td>
                    <td class="icMenu" nowrap> 
                    </td>
                    <td class="icMenu mnuRight" nowrap>
                    </td>
                </tr>
            </tbody>
        </table>       
        <div style="border-bottom: #c2c2bf 1px solid; border-top: #969693 1px solid">
        </div>
            <asp:Panel runat="server" ID="panel1" style="overflow:scroll"> 
                <rad:RadGrid runat="server" ID="gridList" AutoGenerateColumns="False"  AllowPaging="false"
                    AllowSorting="false" onitemdatabound="gridList_ItemDataBound">
                    <ClientSettings EnableClientKeyValues="True">
                        <Selecting AllowRowSelect="True" />
                        <ClientEvents OnRowDblClick="OnRowDblClick" />
                    </ClientSettings>
                    <MasterTableView DataKeyNames="cCusCode">
                        <Columns> 
                           <rad:GridBoundColumn HeaderText="客户名称" DataField="CustomerName"><ItemStyle Width="260px" /></rad:GridBoundColumn>
                           <rad:GridBoundColumn HeaderText="销售员" DataField="Username"><ItemStyle Width="70px" /></rad:GridBoundColumn>
                           <rad:GridBoundColumn HeaderText="账龄(月/天)" DataField="Age"><ItemStyle Width="30px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="发票额" DataField="iNatSum" DataFormatString="{0:N}" ><ItemStyle Width="120px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="累计收款" DataField="iExchSum" DataFormatString="{0:N}" ><ItemStyle Width="120px" /></rad:GridBoundColumn>
                        
                            <rad:GridBoundColumn HeaderText="应收款" DataField="AccountPayable" DataFormatString="{0:N}" ><ItemStyle Width="120px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="应收款-逾期" DataField="AccountPayableEx" DataFormatString="{0:N}" ><ItemStyle Width="120px" /></rad:GridBoundColumn>
                              <rad:GridBoundColumn HeaderText="奖励" DataField="Reward" DataFormatString="{0:N}" ><ItemStyle Width="120px" /></rad:GridBoundColumn>
                            <rad:GridBoundColumn HeaderText="罚息" DataField="Fine" DataFormatString="{0:N}" ><ItemStyle Width="120px" /></rad:GridBoundColumn>
                             <rad:GridTemplateColumn HeaderText="操作">
                                <ItemTemplate>
                                    <asp:LinkButton ID="lnkbtnView" runat="server">查看</asp:LinkButton>
                                </ItemTemplate>
                            </rad:GridTemplateColumn>
                        </Columns>
                    </MasterTableView>
                </rad:RadGrid>  
                   <webdiyer:AspNetPager ID="AspNetPager1" runat="server" CssClass="paginator"   PageSize="20" 
                                CurrentPageButtonClass="cpb" 
                                CustomInfoHTML="第%CurrentPageIndex%页，共%PageCount%页，每页%PageSize%条" 
                                FirstPageText="首页" LastPageText="尾页" NextPageText="下一页" PrevPageText="上一页" 
                                ShowCustomInfoSection="Left" Width="100%" LayoutType="Table"  
                                SubmitButtonClass="but" SubmitButtonText="转到" 
                 onpagechanged="AspNetPager1_PageChanged">
                            </webdiyer:AspNetPager>    
             </asp:Panel>
         </div>
         <asp:HiddenField ID="hfcustsum" runat="server" />
        <asp:HiddenField ID="hfNatSUm" runat="server" />
        <asp:HiddenField ID="hfExchSum" runat="server" />
        <asp:HiddenField ID="hfAccountPayable" runat="server" />
        <asp:HiddenField ID="hfAccountPayableEx" runat="server" />
        <asp:HiddenField ID="hfReward" runat="server" />
        <asp:HiddenField ID="hfFine" runat="server" /></div>
</asp:Content>
